-
Notifications
You must be signed in to change notification settings - Fork 95
Conversation
@@ -15,7 +15,7 @@ | |||
// The goal of this test suite is to verify read/write consistency on volumes | |||
// in accordance with the access updates on the volume | |||
|
|||
// +build runonce | |||
// +build runalways |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the default and hence need not be specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specified explicitly is more clear, and I found "basic_test.go" also specify "runalways".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we do need to add "runalways" explicitly - @shuklanirdesh82 can you please explain the difference between default (no tag) and "runalways"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a limitation of go test -tags <tag_name>
command. There is no way to exclude any tag, as per -tags
tests are picked up with passed value and run. Any test files not labeled with tag falls into default category and end up running multiple times hence tag is required.
Let me explain with following example. let's say we have 3 files a_test.go, b_test.go, c_test.go.
a_test.go => // +build runalways
b_test.go => // +build runonce
c_test.go => no label
We have two targets runalways
and runonce
(https://github.com/vmware/docker-volume-vsphere/blob/master/vmdk_plugin/Makefile#L357).
targets runalways
: includes and ends up running a_test.go
& c_test.go
targets runonce
: includes and ends up running b_test.go
& c_test.go
c_test.go
falls into default and ends up running multiple times hence the tag explicitly needed.
esx_service/utils/kvESX.py
Outdated
@@ -277,6 +277,8 @@ def load(volpath): | |||
return None | |||
|
|||
try: | |||
# Adding this log for DEBUG | |||
logging.warning("kv_str from meta file is %s ", kv_str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should print the json formatted text instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the log so that it only print when the "kv_str" is not a json file.
@@ -57,6 +57,10 @@ func (s *VsanTestSuite) SetUpSuite(c *C) { | |||
} | |||
} | |||
|
|||
func (s *VsanTestSuite) SetUpTest(c *C) { | |||
s.policyList = []string{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: As this is cleaning the list, this step should go to teardown.
You can empty this slice as s.policyList = s.policyList[:0]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put it in the setup is to make sure each test is running from a clean state. I think either way works. So I will keep it as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
1. Adding --rm flag while mounting volume so that containers is removed automatically 2. Test code cleanup while addressing #1 3. Reverting extra logging change added as part of vmware-archive#1388
1. Adding --rm flag while mounting volume so that containers is removed automatically 2. Test code cleanup while addressing #1 3. Reverting extra logging change added as part of vmware-archive#1388
This PR includes: